
#include "iostream"
#include "vector"
#include "unordered_map"
#include "algorithm"

class Solution{

};

int main() {
    int a1,a2,a3,b1,b2,b3,c1,c2,c3,d1,d2,d3;
    bool first=true;
    while (std::cin >> a1>>a2>>a3>>b1>>b2>>b3>>c1>>c2>>c3>>d1>>d2>>d3) {
        int i1=-1,j1=-1,k1=-1,l1=-1;
        for (int i = 0; i <= 100; ++i) {
            for (int j = 0; j <= 100; ++j) {
                for (int k = 0; k <= 100; ++k) {
                    for (int l = 0; l <= 100; ++l) {
                        if(i==0&&k==0&&j==0&&l==0){
                            continue;
                        }
                        if(-a1*i+b1*j+c1*k+d1*l==0
                        &&-a2*i+b2*j+c2*k+d2*l==0
                        &&-a3*i+b3*j+c3*k+d3*l==0
                        ){
                            i1=i;
                            j1=j;
                            k1=k;
                            l1=l;
                            goto end;
                        }
                    }
                }
            }
        }
        end:
        if(i1==-1){
            printf("NONE");
        }else
        {
            printf("%d %d %d %d\n",j1,k1,l1,i1);
        }
        ;
    }
    return 0;
}

